<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>轮询</title>
</head>

<body>
  <div id="root"></div>
  <script>
    /* (function send() {
      let xhr = new XMLHttpRequest()
      xhr.open('get', '/now', true)
      xhr.onload = function () {
        document.querySelector('#root').innerHTML = xhr.responseText
        send()
      }
      xhr.send()
    })(); */
    (async function send() {
      let dt = await (await fetch('/now')).json()
      document.querySelector('#root').innerHTML = dt
    })();
    document.write(1111)
  </script>
</body>

</html>